package com.example.novelstory.service.jzx;


import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.example.novelstory.dao.jzx.NovelDao;
import com.example.novelstory.entity.Novel;
import java.util.List;
import org.springframework.stereotype.Service;

@Service
// * Service实现类    需要继承mybatisplus提供通用的Service基类
// * ServiceImpl<UserDao,User>
// *     2个泛型  1，UserDao,User
// *             2.UserDao 对应的实体
// */
public class NovelServerImpl extends ServiceImpl<NovelDao, Novel> {
//    @Autowired
//    NovelDao novelDao;
//    全查
//    @Override
    public List<Novel> findAkk(){
//        List<Novel> novelList = novelDao.findAkk();
        return list();
    }
//    添加
//    @Override
    public boolean addNovel(Novel novel) {
//        int addNovel = novelDao.addNovel(category,title,author,pic,content,tag,up,down,hits,rating,rating_count,serialize,favorites,position,template,link,create_time,update_time,reurl,status,hits_day,hits_week,hits_month,hits_time,word,recommend);
//        if (addNovel==1){
//            List<Novel> novelList= novelDao.findAkk();
//            return novelList;
//        }else {
//            return null;
//    }
        return save(novel);
    }
    //    删除
//    @Override
    public boolean deleteNovel(int novel_id) {
//        int deleteNovel = novelDao.deleteNovel(id);
//        if (deleteNovel==1){
//            List<Novel>  novelList= novelDao.findAkk();
//            return novelList;
//        }else {
//            return null;
//        }
        return removeById(novel_id);
    }
//    作者查询
//    @Override
//    public boolean findByName(Novel novel) {
//        List<Novel> taskList= novelDao.findByName(author);
//        return taskList;
//    }
////    类容查询
//    @Override
//    public List<Novel> byName(int author) {
//        List<Novel> taskList = novelDao.findByName(author);
//        return taskList;
    }
